using System.Collections.Generic;
using System.Linq;

namespace KTOP.Homeworks.Hw5.Logics.HamiltonianRoutes
{
    internal class HamiltonianRoute
    {
        public IEnumerable<int> Route { get; private set; }
        public HamiltonianRouteType Type { get; private set; }

        public bool IsIteration
        {
            get { return Type == HamiltonianRouteType.Iteration; }
        }

        public bool IsJustAWay
        {
            get { return Type == HamiltonianRouteType.Way; }
        }

        public bool IsEmpty
        {
            get { return Type == HamiltonianRouteType.None; }
        }

        public HamiltonianRoute(IEnumerable<int> route, HamiltonianRouteType routeType )
        {
            Type = routeType;
            Route = route;
        }

        public override string ToString()
        {
            return string.Join("->", Route.Select(v => v + 1));
        }
    }
}